class c4_Strategy

A strategy encapsulates code dealing with file I/O and the system.

Public:

c4_Strategy (c4_File* file_ =0);
Constructs a new strategy object.
virtual ~c4_Strategy ();

virtual bool DataOpen (const char* fileName_, bool allowWriting_);
Opens a data file by name.
virtual void DataSeek (t4_i32 position_);
Sets file position.
virtual int DataRead (void* buffer_, int length_);
Reads a number of bytes.
virtual void DataLoad (void* buffer_, int length_);
Reads an exact number of bytes.
virtual void DataWrite (const void* buffer_, int length_);
Writes a number of bytes.
virtual void DataCommit (t4_i32 newSize_);
Flushes and truncate file.
virtual int StreamRead (void* auxArg_, void* buffer_, int length_);
Consumes some bytes sequentially.
virtual void StreamWrite (void* auxArg_, const void* buffer_, int length_);
Produces some bytes sequentially.
c4_ColCache* _colCache;
Holds a cache manager for all columns.
bool _keepAfterCommit;
Keep data in memory after each commit (default is false).
bool _bytesFlipped;
True if the storage format is not native (default is false).
const t4_byte* _mapStart;
First byte in file mapping, zero if not active.
const t4_byte* _mapLimit;
Past last byte in file mapping, zero if not active.
Protected:

c4_File* _file;
Pointer to file object.


#include "k4strat.h"   // Jun 8, 1997